import {
	request,
	baseUrl
} from "../request.js"

//域名 端口号
//var baseUrl = 'https://wzxlovemzy.com:6001/user'

/**
 * 1，根据账号密码登录
 * @param {Object} password 账号
 * @param {Object} username 密码
 */
export function queryFriendRemarks(fid, type) {
	return request({
		url: baseUrl + '/relation/queryFriendRemarks',
		method: 'POST',
		data: {
			uid: uni.getStorageSync('userId'),
			fid,
			type
		}
	})
}

/**
 * 2，修改朋友备注
 * @param {Object} relationObject 
 */
export function updateFriendRemarks(relationObject) {
	return request({
		url: baseUrl + '/relation/updateFriendRemarks',
		method: 'POST',
		data: {
			uid: uni.getStorageSync('userId'),
			fid: relationObject.id,
			type: relationObject.type,
			friendRemarks: relationObject.friendRemarks
		}
	})
}

/**
 * 3，删除好友
 * @param {Object} fid 好友id
 */
export function deleteFriendRemarks(fid) {
	return request({
		url: baseUrl + '/relation/deleteFriendRemarks',
		method: 'POST',
		data: {
			uid: uni.getStorageSync('userId'),
			fid
		}
	})
}

/**
 * 
 */
export function addFriendMsg(searchId, userId) {
	return request({
		url: baseUrl + '/relation/addFriendMsg?searchId=' + searchId + '&userId=' + userId,
		method: 'GET'
	})
}
